# $Id: PKGBUILD 85713 2013-03-05 14:28:13Z foutrelis $
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>

pkgname=frostwire
pkgver=5.5.5
pkgrel=1
pkgdesc="BitTorrent client with integrated search"
arch=('any')
url="http://www.frostwire.com"
license=('GPL')
depends=('java-runtime' 'mplayer' 'hicolor-icon-theme' 'desktop-file-utils'
         'gtk-update-icon-cache')
install=frostwire.install
source=(http://dl.frostwire.com/$pkgname/$pkgver/$pkgname-$pkgver.noarch.tar.gz
        frostwire.sh
        icons.tar.gz
        java-version-detection.patch)
sha256sums=('4cca813c40dfef3f2a7d43afafae332706dc9faf634ae186fd83f6734adeed43'
            '9a05e5f1005856cd67f6e01fc499d1b64bc372bf3a390e412359196f65cc0ea6'
            '00e425501b33b7213a337314a5035d52459f743f623f9f37abbc60d6e56a2186'
            '50828981c20273c86ef7c05f801d0fcec28253a544f95e231db35402c738a62e')

package() {
  cd "$srcdir/$pkgname-$pkgver.noarch"

  # FS#15544 (Java version detection fails when _JAVA_OPTIONS is set)
  patch -Np0 -i "$srcdir/java-version-detection.patch"

  install -d "$pkgdir/usr/share/$pkgname"
  cp -r * "$pkgdir/usr/share/$pkgname"
  cp -r "$srcdir/icons" "$pkgdir/usr/share"

  install -D "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
  install -Dm644 $pkgname.desktop "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm644 "$srcdir/icons/hicolor/16x16/apps/$pkgname.png" \
    "$pkgdir/usr/share/pixmaps/$pkgname.png"

  # Remove uneeded files
  rm -rf "$pkgdir"/usr/share/frostwire/{runFrostwireOSX.sh,unpack200.py,root/{.svn,magnet10/.svn}}
}

# vim:set ts=2 sw=2 et:
